package com.bykj.property.mapper.provider;

import com.bykj.property.controller.vo.request.PendingPaymentRecordPageRequest;
import org.apache.ibatis.jdbc.SQL;

/**
 * @author yiming
 * @title: PendingPaymentRecordSql
 * @projectName property
 * @description: TODO
 * @date 2019/6/2922:58
 */
public class PendingPaymentRecordSql {
    public String getSql(PendingPaymentRecordPageRequest pageRequest){
        return new SQL() {
            {
                SELECT("*");
                FROM("pending_payment_record");
                if(pageRequest.getChargeTypeId()!=null){
                    WHERE("charge_type_id=#{chargeTypeId}");
                }
                if(pageRequest.getPmVillageId()!=null) {

                    WHERE("pm_village_id = #{pmVillageId}");
                }
                if(pageRequest.getPmUnitId()!=null) {

                    WHERE("pm_unit_id = #{pmUnitId}");
                }
                if(pageRequest.getPmProprietorId()!=null) {

                    WHERE("pm_proprietor_id = #{pmProprietorId}");
                }




            }
        }.toString();

    }

}
